<?php


namespace App\Transformers\Wechat;


use League\Fractal\TransformerAbstract;

class WechatMediaTransFormer extends TransformerAbstract
{
    public function transform($data)
    {
    return [
         'id'=>$data->id,
         'key_id' =>$data->key_id ?? '',
         'media_id' =>$data->media_id ?? '',
         'type' =>$data->type ?? '',
         'content' =>$data->content ?? '',
         'path' =>$data->path ?? '',
         'url' =>$data->url ?? '',
         'temporary' =>$data->temporary ?? '',
        'deleted_at' => $data->deleted_at ? $data->deleted_at->format("Y-m-d H:i:s") : '',
        'created_at' => $data->created_at ? $data->created_at->format("Y-m-d H:i:s") : '',
        'updated_at' => $data->updated_at ? $data->updated_at->format("Y-m-d H:i:s") : '',
    ];

    }

}
